#ifndef _HARDWARE_SPI_H_
#define _HARDWARE_SPI_H_
#include <avr/io.h>
#include <avr/interrupt.h>

	//set spi prescaller
enum SPI_Prescaler { SPI_4, SPI_16, SPI_64, SPI_128, SPI_2, SPI_8, SPI_32, SPI_64_2};

class Spi
{
	public:
	void init();
	//sets spi up as master
	void setMaster();
	//set spi up as slave
	void setSlave();
	//enable hardware spi
	void setEnable(unsigned char flag);

	//set polarity and phase
	void setPolarityPhase(unsigned char pol, unsigned char phase);
	//enables spi interrupt
	void setSPI_Interrupt(unsigned char s);
	//sets the spi interrupt flag
	void setSPI_transmissionFlag(unsigned char flag);
	//set the data order of transmission
	void setDataOrder(unsigned char flag);

	void setPrescaler(unsigned char prescaler);

	//grabs data that has been received
	void getSPI_ReceivedData(unsigned char* value);

	//sets the data to be sent
	void setData(unsigned char send);

	//performs set of interrupt operations for spi 
	void performSPI_Interrupt();

}

#endif
